<!DOCTYPE html>
<html>
	<head>
		<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="../../css/iuapmobile.um.css">
		<link rel="stylesheet" href="../../css/font-icons.css">
		<link rel="stylesheet" type="text/css" href="../../css/iuapmobile.um.listview.css">

		<style>
			.msg-info {
				position: relative;
			}
			.msg-info .um-badge {
				position: absolute;
				right: -10px;
				font-size: 12px;
			}
			.msg-header {
				width: 40px;
				height: 40px;
				line-height: 40px;
				background: blue;
				border-radius: 50%;
				text-align: center;
				color: white;
			}

		</style>

		<script src="../../js/summer.js" ></script>
		<script src="../../js/jquery.min.js" ></script>
		<script src="../../js/Frameworks/iuapmobile.frameworks.ui.js" ></script>
		<script type="text/javascript" src="../../js/knockout.js"></script>

		<script type="text/javascript" src="../../js/Frameworks/iuapmobile.frameworks.listview.js"></script>
	</head>
	<body class="f14">
		<div class="um-win" id="Constructionlist">
			<div class="um-header" >
				<h3>拆机完成列表</h3>
				<a href="#" class="um-back back" >返回</a>
			</div>
			<div class="um-content">

				<div class="um-input-group">
					<span class="ti-search"></span>
					<input type="search" class="form-control" placeholder="search">
				</div>

				<div class="um-listview-wrap" id="listview">
					<ul class="um-list um-no-active" data-bind="foreach: data">
						<li class="um-listview-row" >
							<a href="#" class="um-list-item um-swipe-action um-no-icon">
							<div class="um-list-item-inner">
								<div class="um-list-item-body um-text-overflow f14" style="padding-right:5px;">
									<div class="um-bgc-blue um-white pt5 pb5 ">
										︱商家编号:<span data-bind="text:sjbh1"></span>
									</div>
									<div class="w">
										<div class="um-md-6 w_50 fl mt10 mb10">
											派工日期:<span data-bind="text:pgrq1"></span>
										</div>
										<div class="um-md-6 w_50 fl mt10 mb10">
											派工时间:<span data-bind="text:pgsj1"></span>
										</div>
									</div>
									<div class="w">
										<div class="um-md-6 w_50 fl mt10 mb10">
											要求竣工日期:<span data-bind="text:yqjgrq1"></span>
										</div>
										<div class="um-md-6 w_50 fl mt10 mb10">
											加急类型:<span data-bind="text:jjlx1"></span>
										</div>
									</div>
									<div class="w">
										<div class="um-md-6 w_50 fl mt10 mb10">
											工程主管:<span data-bind="text:gczg1"></span>
										</div>
										<div class="um-md-6 w_50 fl mt10 mb10">
											点位号:<span data-bind="text:pointId"></span>
										</div>
									</div>
									<!--<div class="w">
									<div class="um-md-6 w_50 fl mt10 mb10">
									状态:<span data-bind="text:status"></span>
									</div>
									</div>-->
								</div>
							</div> </a>
						</li>
					</ul>
				</div>

			</div>

			<div class="um-footer">

			</div>
		</div>
		<script>
			var updateList;
			$(function() {
				var installListindex = 1;
				var installList = [];
				var times = 1;
				var ViewModel = function() {
				};
				var viewModel = new ViewModel();
				var pageIndexNow = 0;
				//构造控件实例
				var listview = UM.listview("#listview");
				//当前第几页
				viewModel.data = ko.observableArray([]);
				ko.applyBindings(viewModel);
				//绑定叶号，是否第一次bool
				updateList = function(index, cout) {
					/*doPost(adressHead.ISjtzImpl, "getAzPgxxList", {
					 dataParm : {
					 empId : summer.getStorage("userinfo").empId,
					 star : index,
					 status : 4 + "," + 6,
					 count : cout
					 }
					 }, function(data) {
					 if (index == 1) {
					 try {
					 while (viewModel.data.shift()) {
					 }
					 } catch(e) {
					 }
					 };
					 if (data.result == 1) {
					 if (data.data.length != "") {
					 for (var i = 0; i < data.data.length; i++) {
					 console.log("aaaa" + data.data[i]);
					 var msgtype = parseInt(data.data[i].type) - 1;
					 viewModel.data.push({
					 'sjbh1' : data.data[i].businessId,
					 'pgrq1' : data.data[i].dispatchDate.substr(0, 10),
					 'pgsj1' : data.data[i].dispatchTime.substr(11, 18),
					 'yqjgrq1' : data.data[i].requiredCompletionDate.substr(0, 10),
					 'jjlx1' : data.data[i].expressType == "N" ? "否" : "是",
					 'gczg1' : data.data[i].engineeringSupervisor,
					 'bodyid' : data.data[i].bodyid,
					 'pointId' : data.data[i].pointId,
					 'status' : data.data[i].status == "4" ? "设备签收" : "施工整改"
					 });
					 };
					 installListindex += data.data.length;
					 } else {
					 if (times != 1) {
					 UM.toast({
					 title : '友情提示：',
					 text : '没有更多单据',
					 duration : 1000
					 });
					 }
					 times++;
					 }
					 } else {
					 UM.toast({
					 title : '友情提示：',
					 text : data.msg,
					 duration : 1000
					 });
					 }
					 listview.refresh();
					 }, function(err) {
					 console.log(err);
					 });*/
					viewModel.data.push({
						'sjbh1' : "wde123", //data.data[i].businessId,
						'pgrq1' : "cwwew", //data.data[i].dispatchDate.substr(0, 10),
						'pgsj1' : "wceqf", //data.data[i].dispatchTime.substr(11, 18),
						'yqjgrq1' : "wveqwev", //data.data[i].requiredCompletionDate.substr(0, 10),
						'jjlx1' : "7g34rg", //data.data[i].expressType == "N" ? "否" : "是",
						'gczg1' : "qewrf34", //data.data[i].engineeringSupervisor,
						'bodyid' : "323", //data.data[i].bodyid,
						'pointId' : "wef3f", //data.data[i].pointId,
						'status' : "设备拆机",//data.data[i].status == "4" ? "设备签收" : "施工整改"
					});
				};
				window.bind = function() {
					updateList(1, 4);
				};
				//添加控件方法
				listview.on("pullDown", function(sender) {
					updateList(1, 4);
					//viewModel.data.unshift(row);
					sender.refresh();
				});
				listview.on("pullUp", function(sender) {
					updateList(installListindex, 4);
					sender.refresh();
				});
				listview.on("itemClick", function(sender, args) {
					setTimeout(function() {
						summer.openWin({
							id : "detail",
							url : "html/disassemble_Construction/Dispatch_detail.html",
							/*pageParam : {
							 bodyid : viewModel.data()[args.rowIndex].bodyid,
							 billcode : viewModel.data()[args.rowIndex].billcode
							 }*/
						});
					}, 100);
					//alert(args.rowIndex);
					//这里可以处理行点击事件，参数sender即为当前列表实例对象，args对象有2个属性，即rowIndex(行索引)和$target(目标行的jquery对象)
					//alert("您点击了列表的第" + (args.rowIndex + 1) +　"行！");
				});

			});
			summerready = function() {
				updateList(1, 4);
			};
			function rebind() {
				window.bind();
			}
		</script>
	</body>
</html>
<script type="text/javascript" src="../../js/Myjs/Common.js"></script>